Open
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes logging by introducing a flexible CompositeLogger that supports multiple backends (wandb, TensorBoard, local JSON/PNG, and console) and updating all training scripts to use it.
- Added
utils/logger.pycontainingBaseLoggerand concrete loggers (WandbLogger,TensorboardLogger,LocalLogger,ConsoleLogger, andCompositeLogger). - Modified
train_tokenizer.py,train_lam.py, andtrain_dynamics.pyto remove direct wandb usage and configure logging viaCompositeLogger. - Updated each script’s
Argsto specifylog_dirand a list of desiredloggers.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| utils/logger.py | New module defining an abstract logger interface and four implementations, plus a composite wrapper. |
| train_tokenizer.py | Replaced wandb calls with CompositeLogger; changed CLI args to loggers list instead of a flag. |
| train_lam.py | Same updates as tokenizer training: use CompositeLogger and new loggers/log_dir args. |
| train_dynamics.py | Aligned with other scripts to use CompositeLogger; removed direct wandb integration. |
Comments suppressed due to low confidence (1)
utils/logger.py:233
- [nitpick] Using the key
"tb"for TensorBoard may be unclear to new users. Consider renaming it to"tensorboard"or providing both aliases for clarity.
"tb": TensorboardLogger,
|
Since we are going to do proper logging, do we want to switch from prints to proper python logging? |
emergenz
requested changes
Jul 9, 2025
emergenz
left a comment
There was a problem hiding this comment.
Switch to python logging in consoleLogging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added support for multiple loggers:
wandb

tensorboard

local

console
